

#include "uart.h"


Uart_Communication Uart0;//

//析构函数
Uart_Communication::Uart_Communication(void)
{

}

Uart_Communication::~Uart_Communication(void)
{

}

/*
int Uart_Communication::Uart_Init(char* device, int baud)
{
	//int fd;
    if(wiringPiSetup() < 0)return -1;

    if((usart_fd = serialOpen("/dev/ttyAMA0", 115200)) < 0)return 1;

	if((uart_fd = serialOpen(device, baud)) < 0)return -1;
	
    printf("Uart_Init ok\n");

    serialPrintf(uart_fd, "Hello World!!!\n");
    
	return 1;
	
}

int Uart_Communication::Recv(void)
{
	unsigned char temp;
	//int len = serialDataAvail(uart_fd);
	//serialPutchar(uart_fd, '1');
	if(serialDataAvail(uart_fd) > 0)
	//if(len > 0)
	{
		//printf("%d:", len);
		//putchar(serialGetchar(fd));
		temp=serialGetchar(uart_fd);//
		printf("%c\n", temp);//
		
		//serialPutchar(uart_fd, temp);
	}
	
	return 0;
}


void Uart_Communication::Uart_Close(void)
{
	serialClose(uart_fd);	
}

*/




